<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ page import="java.util.*" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
 <%@taglib prefix="s" uri="/WEB-INF/Pagination.tld"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script>

function submitRequest(option)
{ 


	 document.list.option.value=option;
	 //alert(document.list.city.value);
			document.list.action="/VisionERPEnggItem/pagination.htm";
			document.list.submit();
	
 }
function SendValueToParent(item){
	
	 //alert(item);
	 if (window.opener != null && !window.opener.closed) {
			for (var i = 0; i < item.length; i++) {

				var button = item(i);
				if (button.checked) {
					value = button.value;

					break;

				}
			}
			var txtName = window.opener.document.getElementById("radio");
			//alert("this is from pickitemlist.jsp " +value);
			//alert(txtName);
			//alert(txtName.name);
			txtName.value = value;
			
			//alert(txtName.value);
		}
	 //alert("Before window close");
		window.close();
	} 

	

</script>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>

<form name="list">
<table>

<tr>
<td></td>
<td>PartNumber</td>
<td>partType</td>
<td>revision</td>
<td>description</td>
</tr>
<%--   <s:Populate startIndex="${startIndex}"  maxIndex="${maxIndex}" list="${list}">

</s:Populate> --%>
<c:forEach var= "item" items ="${itemList}" begin="${startIndex}" end="${maxIndex}" step="1">
<tr>
<td> <input type="radio" name="radio1" value="${item.pk.partNumber}"/>${item.pk.partNumber}</td>
<td> ${item.pk.partType}</td>
<td>${item.revision}</td>
<td>${item.description}</td>
</tr>
</c:forEach> 

<tr>
   <td width="10">&nbsp;</td> 
<td>
<td><input type="hidden" name="option" value="option"/></td>
<td><a href="javascript:submitRequest('first')"> First </a></td>
<td><a href="javascript:submitRequest('previous')"> Prev </a></td> 
<td><a href="javascript:submitRequest('next')"> Next </a></td> 
<td><a href="javascript:submitRequest('last')"> Last </a></td>
</td>
</tr>
<tr>
<td><input type="submit" name="select" value="OK" onclick="javascript: return SendValueToParent(document.list.radio1);"></td>
</tr>
</table>
</form>


</body>
</html>